import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../controllers/settings_controller.dart';
import '../controllers/login_controller.dart';
import '../widgets/user_profile.dart';
import '../widgets/vip_upgrade_banner.dart';
import '../widgets/settings_menu.dart';
import '../widgets/login_dialog.dart';

class SettingsPage extends StatelessWidget {
  const SettingsPage({super.key});

  @override
  Widget build(BuildContext context) {
    // 初始化设置控制器和登录控制器
    Get.put(SettingsController());
    Get.put(LoginController());

    return Stack(
      children: [
        Container(
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage("assets/images/pic_contract_bg.png"),
              fit: BoxFit.fill,
            ),
          ),
          child: SingleChildScrollView(
            child: Column(
              children: [
                SafeArea(child: Container()),

                // 用户信息组件
                const UserProfile(),

                SizedBox(height: 16.h),
                // VIP升级横幅组件
                const VipUpgradeBanner(),

                // 设置菜单组件
                const SettingsMenu(),

                SizedBox(height: 20.h),
              ],
            ),
          ),
        ),

        // 登录弹窗
        const LoginDialog(),
      ],
    );
  }
}
